/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Estimator;

/**
 *
 * @author mwh
 */
public class LaPlaceSuffix extends EmpSuffix {

    EmpSuffix emp;

    double disc;

    public LaPlaceSuffix(EmpSuffix emp) {
        this.emp = emp;
        this.diffSuf = emp.diffSuf;
        this.totalSuf = emp.totalSuf;
        this.wordsCount = emp.wordsCount;
        disc = ((double) 1) / ((double) diffSuf);

    }

    @Override
    public double getCount(String s) {
        //double lc = (double) (emp.getCount(s) + 1) / (totalSuf + diffSuf);
        double lc =  (((double) emp.getCount(s)) + disc) / ((double) totalSuf + 1.0);
        //   System.err.println("    lapcount: " + lc);
        return lc;
    }
}
